<template>
  <div>
    <p>欢迎光临_vue开发的收银系统的水果店</p>
    <p>苹果{{jin}}￥/斤,折扣《{{zhe}}折》</p>
   请输入您要购买的斤数 <input v-model="count" type="number">
   <button @click="jie">结账买单~</button>
   <p>结账单:总价:{{total}} ￥元 折后价: {{discount}} ￥元 省了:{{save}} ￥元</p>
  </div>
</template>

<script>
export default {
  name: 'Homework2App',

  data() {
    return {
      jin:'10',
      zhe:'8',
      total:'0',
      discount:'0',
      save:'0',
      count:'0',
      
    };
  },

  mounted() {
    
  },

  methods: {
    jie(){
      this.total =this.jin * this.count
      this.discount = this.jin*this.count * this.zhe/10
      this.save = this.total - this.discount
    }
  },
};
</script>

<style lang="scss" scoped>

</style>